package DemoText;
import java.util.Scanner;

/**
 * 乘法表
 */
public class LuoGuP8723 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int p = in.nextInt();
        for (int i = 1; i < p; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(abc(i) + "*" + abc(j) + "="+jz(i*j, p) + " ");
            }
            System.out.println();
        }
    }

    public static String jz(int a,int b) {
        String str = "";
        while(a!=0) {
            str= abc(a%b) + "" + str;
            a = a/b;
        }
        return str;
    }

    public static char abc(int a) {
        if(a<10) {
            return (char)(a+48);
        }else {
            return (char)(a+65-10);
        }
    }
}
